//
//  PublicSigmentView.h
//  Yanwei
//
//  Created by Seven-Augus on 2017/5/10.
//  Copyright © 2017年 DCloud. All rights reserved.
//

#define DDMWIDTH [UIScreen mainScreen].bounds.size.width

#define DDMHEIGHT [UIScreen mainScreen].bounds.size.height

#define DDMColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]

#import <UIKit/UIKit.h>

@class PublicSigmentView;

@protocol PublicSigmentViewDelegate <NSObject>

@optional

/**
 * @pramga 点击横向点击事件
 * sengment sengment对象
 * index 点击的索引
 */
- (void)segment:(PublicSigmentView *)sengment didSelectColumnIndex:(NSInteger)index;

//- (void)segment:(PublicSigmentView *)sengment scrollMenuViewSelectedIndex:(NSInteger)index;

@end

@interface PublicSigmentView : UIView

@property (nonatomic,strong) NSArray *titleArry;

/** 未选中时的文字颜色, 默认颜色DDMColor(80, 80, 80) */
@property (nonatomic, strong) UIColor *titleColorNormal;

/** 选中时的文字颜色，默认颜色DDMColor(30, 137, 255) */
@property (nonatomic,strong) UIColor *titleColorSelect;

/** 底线颜色 */
@property (nonatomic, strong) UIColor *bottomLineColor;

/** title底线颜色 */
@property (nonatomic, strong) UIColor *titleLineColor;
/** 底线高 */
@property (nonatomic, assign) CGFloat bottomLineHeight;

@property (strong, nonatomic) UIFont * titleSelectFont;
/** 字体大小，默认15 */
@property (nonatomic, strong) UIFont *titleFont;

/** 默认选中的index = 1，即第一个 */
@property (nonatomic, assign) NSInteger defaultIndex;

@property (nonatomic, strong) NSString *text;

@property (nonatomic, weak) id<PublicSigmentViewDelegate>delegate;

- (instancetype)initWithOrgin:(CGPoint)origin andHeight:(CGFloat)height;

- (void)scrollMenuViewSelectedoffsetX:(NSInteger)selectIndex withOffsetType:(BOOL)types;

/** 修改下划线和控制器 */
- (void)selectDefaultBottomAndVC:(NSInteger)DefaultIndex;

@end
